<template>
    <page class="like" :top="46" :bottom="0">
        <van-nav-bar fixed title="我的收藏" left-arrow @click-left="back()" />
        <div class="likes">
            <!-- <div v-if="state.likeList!=null">没有数据</div> -->
            <item  :list="state.likeList"></item>
        </div>

    </page>
</template>
   
<script setup lang="ts">

import { onMounted, reactive, } from "vue";
import { useRouterAction } from "@/utils/router";

import { likeList } from "@/serve/_";
const { back, push } = useRouterAction()

// import {  showToast } from 'vant';
import { IndexType } from "@/types/res/likes";



//定义变量
const state: {
    value: string,//搜索框的关键字
    likeList: [] | IndexType,//接口请求到的字段
} = reactive({
    value: '',
    likeList: []
})

onMounted(() => {
    getlikeList()
    // console.log("搜索");

})

// 点击搜索或回车执行的方法
let getlikeList = async () => {
    state.likeList = await likeList({
        // keyword: state.value
    });
    console.log("res", state.likeList);

}

// 点击取消执行的方法
let onCancel = () => {
    console.log("value", "取消");
}

</script>
   
<style lang="less" scoped>@import "@page/search.less";</style>
   